import {Component} from "react";

export default class ExampleComponent extends Component {
    state = {
        count: 0,
        boolean: false
    };

    handleClick = () => {
        // this.setState({ count: this.state.count + 1 });
        this.setState({ boolean: !this.state.boolean})
        console.log("this.state.boolean1",this.state.boolean)
        this.setState({ boolean: !this.state.boolean})
        console.log("this.state.boolean2",this.state.boolean)
        this.setState({ boolean: !this.state.boolean})
        console.log("this.state.boolean3",this.state.boolean)
        setTimeout(() => {
            this.setState({ boolean: !this.state.boolean})
            console.log("this.state.boolean4",this.state.boolean)
        },100)
        // this.setState({ count: this.state.count + 1 });
        // this.handleClick2()
    };

    handleClick2 = () => {
        this.setState({ count: this.state.count + 1 });
        this.handleClick3()

    }
    handleClick3 = () => {
        setTimeout(() => {
            this.setState({ count: this.state.count + 1 });
        })
        // this.setState({ count: this.state.count + 1 });
        // this.handleClick3()

    }
    render() {
        console.log("Render334242 triggered");
        return (
            <div>
                <p>Count: {this.state.count}</p>
                <button onClick={this.handleClick}>Increment</button>
            </div>
        );
    }
}
